home *** CD-ROM | disk | FTP | other *** search
- Path: news.sci.fi!usenet
- From: caprice@sci.fi (Niklas Lakanen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Screen W/Custom Pens. HELP!
- Date: 2 Mar 1996 13:22:39 GMT
- Organization: Scifi Communications International, http://www.sci.fi/, helpdesk@sci.fi, (931)3186277
- Message-ID: <2454.6635T892T1782@sci.fi>
- References: <4h3geg$qa4@aggedor.rmit.EDU.AU>
- NNTP-Posting-Host: xvi.dyn.sci.fi
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
- >static UWORD mypens[] = {
- > 0x999, 0x000, 0xfff, 0x57a,
- > 0x888, 0xaaa, 0xa98, 0xe9a, ~0
- > };
-
- Pens are not the colors you want to the screen. With them you can define
- which colornumber to use in different places on the screen.
-
- There are 12 pens that you are able to define:
- DETAILPEN
- BLOCKPEN
- TEXTPEN
- SHINEPEN
- SHADOWPEN
- FILLPEN
- FILLTEXTPEN
- BACKGROUNDPEN
- HIGHLIGHTTEXTPEN
- /* V39 and above */
- BARDETAILPEN
- BARBLOCKPEN
- BARTRIMPEN
-
- So, this is what you do if you want to use pen number 1 as DETAILPEN, 3 as
- BLOCKPEN, and so on:
-
- UWORD mypens[] = {
- 1, 3, 1, 2, 2, 2, 2, 1, 1, 3, 4, 5 };
- ...
- SA_Pens, (ULONG)mypens,
- ...
-
- >I have the Depth correct etc... it opens fine but the colours are not
- >even the ones I have specified. if I just have { ~0 } in the array, it
- >opens fine w/the WB colours in the correct places and all.
-
- {~0} uses the default pens.
-
- >I have also tried putting
- > SA_Colors, (ULONG)otherpens,
- >otherpens being
- >struct UWORD otherpens[] = {~0};
-
- I undestoood that you want to change the palette, am I right?
-
- SA_Colors tag wants an array of ColorSpec structures as an argumet.
-
- /* From intuition.h */
- struct ColorSpec
- {
- WORD ColorIndex; /* -1 terminates an array of ColorSpec */
- UWORD Red; /* only the _bottom_ 4 bits recognized */
- UWORD Green; /* only the _bottom_ 4 bits recognized */
- UWORD Blue; /* only the _bottom_ 4 bits recognized */
- };
-
-
- To define the colors for 8 color screen:
-
- struct ColorSpec mycolors[9]=
- {
- 0, 9, 9, 9, // GRAY
- 1, 0, 0, 0, // BLACK
- 2, 0,15, 0, // GREEN
- 3,15,15, 0, // YELLOW
- 4, 0, 0,15, // BLUE
- 5,15, 0,15, // MAGENTA
- 6, 0,15,15, // CYAN
- 7,15,15,15, // WHITE
- -1,0, 0, 0}; // TERMINATOR
- ...
- OpenScreenTags(
- ...
- SA_Colors, mycolors,
- ...
-
-
- As you can see, this method is useable only with screens with colors up to 16.
- To define colors for 256-color screen it's posiible to use SA_Colors32 tag. It
- takes as a parameter a table which it can pass to LoadRGB32() function.
-
- >Any help will be nice.. since the RKRM's only mention that you can change
- >the palette, but no proper example (which would have been easy since it
- >says something like: 'The following example doesn't have custom pens, but
- >you can do it')
-
- I write quite bad English, but hope this helps you even a little..
-
-
- - Caprice
-
-